﻿Module Main
    Dim FormSplash As intro
    Dim SplashTimer As Timer

    Public Sub Main()
        Application.EnableVisualStyles()

        SplashTimer = New Timer
        AddHandler SplashTimer.Tick, AddressOf TimerTick
        SplashTimer.Interval = 2000
        SplashTimer.Start()
        FormSplash = New intro
        FormSplash.ShowDialog()

        If Mandar_a_ProbarConexion() Then
            If My.Forms.XFormLogin.ShowDialog = DialogResult.OK Then
                Application.DoEvents()
                Application.Run(New RFormPrincipal)
            End If
        Else
            If XFormConfigConexion.ShowDialog = DialogResult.OK Then
                If My.Forms.XFormLogin.ShowDialog = DialogResult.OK Then
                    Application.DoEvents()
                    Application.Run(New RFormPrincipal)
                End If
            End If
        End If
    End Sub

    Private Sub TimerTick(sender As Object, e As EventArgs)
        SplashTimer.Stop()
        FormSplash.Close()
    End Sub

    Public Structure JuezUsuario
        Public IDJuez As Integer
        Public Usuario As String
        Public Nombre As String
        Public Apellido As String
        Public TipoAcceso As Integer '1 para juez y 2 para admin
    End Structure

    Public Structure Evento
        Public IDEvento As Integer
        Public Anio As Integer
    End Structure

    Public JuezActivo As JuezUsuario
    Public EventoActivo As Evento
End Module
